<root xmlns="http://www.w3.org/1999/xhtml"
      xmlns:py="http://genshi.edgewall.org/"
      xmlns:xi="http://www.w3.org/2001/XInclude">
    <xi:include href="rds.html" />

<?python
    from genshi.input import XML, HTML
    from datetime import datetime, date, timedelta
    import time
?>

<report>
    <pages>
        <?python
            time_format = "%Y-%m-%d"
            params = dict(
                timetable_date = datetime.fromtimestamp(time.mktime(time.strptime(timetable_date, time_format))).date(),
                show_teacher = show_teacher == "True",
                show_dates = show_dates == "True",
                show_time = show_time == "True",
                show_place = show_place == "True",
                show_unused = show_unused == "True",
                show_names = int(show_names),
            )
            errors = []
        ?>
        <page py:for="classroom in [model.Classroom.get(x) for x in ids]"
            py:attrs="{'title': '%s, #%d' % (classroom.office.name, classroom.roomNumber)}">
            ${HTML(generate_timetable_commands(classroom, 8, params, errors))}
        </page>

    </pages>
    <errors py:if="errors" py:strip="True">
        ${HTML(process_errors(errors))}
    </errors>
</report>

</root>
